package com.neo.util;



import org.springframework.util.StringUtils;

import java.util.*;

public class ComputerUtil {
    String uuid = UUID.randomUUID().toString();
    //参数表后评价输入界面
    Map<String, String> hpjsrjmmap;
    public static final String[] STR_LIST =
            {"C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X"};

    public ComputerUtil(Map<String, String> map) {
        this.hpjsrjmmap = map;
    }

    //5发电量
    public List<HpjParamer> fadianliang(String D6) throws IllegalAccessException {

        List<HpjParamer> jsgclist = new ArrayList<>();
        for (int i = 0; i < 21; i++) {
            HpjParamer hpjparamer = new HpjParamer();
            hpjparamer.setUuid(uuid);
            hpjparamer.setPosition(STR_LIST[i] + 5);
            if (i == 0) {
                // 后评价输入界面!C17/D6

                Double fdl0 = MathUitl.div(Double.valueOf(hpjsrjmmap.get("C17")), Double.valueOf(D6), 5);
                hpjparamer.setComputer(String.valueOf(fdl0));
            } else {
                //后评价输入界面!C17*(1-后评价输入界面!C18)*后评价输入界面!$C$9/10  D5
                // 后评价输入界面!D17*(1-后评价输入界面!D18)*后评价输入界面!$C$9/10 E5
                String p1 = hpjsrjmmap.get(STR_LIST[i - 1] + 17);
                String p2 = hpjsrjmmap.get(STR_LIST[i - 1] + 18);
                String p3 = hpjsrjmmap.get("C" + 9);
                if (p1 == null) {
                    p1 = "0";
                }
                if (p2 == null) {
                    p2 = "0";
                }
                if (p3 == null) {
                    p3 = "0";
                }
                if (p1 != null && p2 != null && p3 != null) {
                    Double fdl0 = Double.valueOf(p1) * (1 - Double.valueOf(p2)) * Double.valueOf(p3) / 10;
                    hpjparamer.setComputer(String.valueOf(fdl0));
                } else {
                    hpjparamer.setComputer("0");
                }

            }
            jsgclist.add(hpjparamer);

        }
        return jsgclist;
    }

    //6效率
    public List<HpjParamer> xiaolv(String D6) {
        List<HpjParamer> xiaolvlist = new ArrayList<>();
        Map<String, String> map = new HashMap<>();
        for (int i = 1; i < 21; i++) {
            //D6-0.7%
            //E6-0.7%
            if (i == 1) {
                map.put("D6", D6);
            } else {
                String premeter = map.get(STR_LIST[i - 1] + 6);//获取前任的值
                if (premeter == null) {
                    premeter = "0";
                }
                Double value = MathUitl.sub(Double.valueOf(premeter), 0.007);
                map.put(STR_LIST[i] + 6, String.valueOf(value));
            }
        }
        xiaolvlist = MapToList.mapList(map, uuid);
        return xiaolvlist;
    }

    // 7燃煤电价收入
    public List<HpjParamer> ranmeidianjiashouru(String D6) throws IllegalAccessException {
        //M5*后评价输入界面!L19
        //D5*后评价输入界面!C19
        //  hpjsrjmmap
        List<HpjParamer> ranmeidianjialist = new ArrayList<>();
        Map<String, String> ranmeidianjiashourumap = new HashMap<>();
        //获取发电量
        List<HpjParamer> list = fadianliang(D6);
        Map<String, String> fadianliangmap = ListToMap.getListToMap(list);
        for (int i = 1; i < 21; i++) {
            String s1 = hpjsrjmmap.get(STR_LIST[i - 1] + 19);
            String s2 = fadianliangmap.get(STR_LIST[i] + 5);
            if (s1 == null) {
                s1 = "0";
            }
            if (s2 == null) {
                s2 = "0";
            }
            Double p1 = Double.valueOf(s1);
            Double p2 = Double.valueOf(s2);
            ranmeidianjiashourumap.put(STR_LIST[i] + 7, String.valueOf(MathUitl.mul(p1, p2)));
        }
        ranmeidianjialist = MapToList.mapList(ranmeidianjiashourumap, uuid);
        return ranmeidianjialist;
    }


    // 8 国家补贴收入
    public List<HpjParamer> guojiabutieshouru(String D6) throws IllegalAccessException {
        //D5*后评价输入界面!C20
        // E5*后评价输入界面!D20
        Map<String, String> map = new HashMap();
        List<HpjParamer> gjbtist = new ArrayList<>();
        //获取发电量
        List<HpjParamer> list = fadianliang(D6);
        Map<String, String> fadianliangmap = ListToMap.getListToMap(list);
        for (int i = 1; i < 21; i++) {
            String s1 = hpjsrjmmap.get(STR_LIST[i - 1] + 20);
            String s2 = fadianliangmap.get(STR_LIST[i] + 5);
            if (s1 == null) {
                s1 = "0";
            }
            if (s2 == null) {
                s2 = "0";
            }
            Double p1 = Double.valueOf(s1);
            Double p2 = Double.valueOf(s2);
            map.put(STR_LIST[i] + 8, String.valueOf(MathUitl.mul(p1, p2)));
        }
        //x8求和
        Double value = 0d;
        for (Map.Entry<String, String> entry : map.entrySet()) {
            String svalue = entry.getValue();
            if (svalue == null) {
                svalue = "0";
            }
            Double dvalue = Double.valueOf(svalue);
            value = MathUitl.add(value, dvalue);
        }
        map.put("X8", String.valueOf(value));
        gjbtist = MapToList.mapList(map, uuid);
        return gjbtist;
    }

    // 9  省级补贴
    public List<HpjParamer> shenjibutie(String D6) throws IllegalAccessException {
        // D5*后评价输入界面!C21
        //E5*后评价输入界面!D21
        List<HpjParamer> shenjibutielist = new ArrayList<>();
        Map<String, String> map = new HashMap<>();
        //获取发电量
        List<HpjParamer> list = fadianliang(D6);
        Map<String, String> fadianliangmap = ListToMap.getListToMap(list);
        for (int i = 1; i < 21; i++) {
            String s1 = hpjsrjmmap.get(STR_LIST[i - 1] + 21);
            String s2 = fadianliangmap.get(STR_LIST[i] + 5);
            if (s1 == null) {
                s1 = "0";
            }
            if (s2 == null) {
                s2 = "0";
            }
            Double p1 = Double.valueOf(s1);
            Double p2 = Double.valueOf(s2);
            map.put(STR_LIST[i] + 9, String.valueOf(MathUitl.mul(p1, p2)));
        }
        shenjibutielist = MapToList.mapList(map, uuid);
        return shenjibutielist;
    }

    // 10 增值税
    public List<HpjParamer> zengzhishui(String D6) throws IllegalAccessException {
        //D11-D12
        //E11-E12
        //F11-F12
        List<HpjParamer> list11 = zengzhishuixiaoxiang(D6);
        List<HpjParamer> list12 = zengzhishuijingxiang(D6);
        Map<String, String> map11 = ListToMap.getListToMap(list11);
        Map<String, String> map12 = ListToMap.getListToMap(list12);
        Map<String, String> map10 = new HashMap<>();
        for (int i = 1; i < 21; i++) {
            String s11 = map11.get(STR_LIST[i] + 11);
            String s12 = map12.get(STR_LIST[i] + 12);
            strIsNUll(s11);
            strIsNUll(s12);
            Double d11 = Double.valueOf(s11);
            Double d12 = Double.valueOf(s12);
            map10.put(STR_LIST[i] + 10, String.valueOf(d11 - d12));
        }
        List<HpjParamer> list = MapToList.mapList(map10, uuid);
        return list;
    }

    // 11 增值税销项
    public List<HpjParamer> zengzhishuixiaoxiang(String D6) throws IllegalAccessException {
        //(D7+D8+D9)/1.17*0.17  D11
        //(E7+E8+E9)/1.17*0.17  E11
        List<HpjParamer> list7 = ranmeidianjiashouru(D6);//7
        List<HpjParamer> list8 = guojiabutieshouru(D6);//8
        List<HpjParamer> list9 = shenjibutie(D6);//9
        Map<String, String> map7 = ListToMap.getListToMap(list7);
        Map<String, String> map8 = ListToMap.getListToMap(list8);
        Map<String, String> map9 = ListToMap.getListToMap(list9);
        Map<String, String> map11 = new HashMap<>();
        for (int i = 1; i < 21; i++) {
            String s7 = map7.get(STR_LIST[i] + 7);
            String s8 = map8.get(STR_LIST[i] + 8);
            String s9 = map9.get(STR_LIST[i] + 9);
            if (s7 == null) {
                s7 = "0";
            }
            if (s8 == null) {
                s8 = "0";
            }
            if (s9 == null) {
                s9 = "0";
            }
            Double d7 = Double.valueOf(s7);
            Double d8 = Double.valueOf(s8);
            Double d9 = Double.valueOf(s9);
            Double value = (d7 + d8 + d9) / 1.17 * 0.17;
            map11.put(STR_LIST[i] + 11, String.valueOf(value));
        }
        List<HpjParamer> list = MapToList.mapList(map11, uuid);
        return list;
    }

    // 12 增值税进项
    public List<HpjParamer> zengzhishuijingxiang(String D6) throws IllegalAccessException {
        Map<String, String> map = new HashMap<>();
        Map<String, String> zzsxxMap = ListToMap.getListToMap(zengzhishuixiaoxiang(D6));
        //后评价输入界面!C10 C12
        for (int i = 0; i < 21; i++) {
            if (i == 0) {
                map.put(STR_LIST[i] + 12, hpjsrjmmap.get(STR_LIST[i] + 10));
            } else {
                //IF(SUM(D11:D11)<=C12,D11,IF((C12-SUM(D11:D11)+D11)>0,C12-SUM(D11:D11)+D11,0))    D12
                //IF(SUM(D11:E11)<=C12,E11,IF((C12-SUM(D11:E11)+E11)>0,C12-SUM(D11:E11)+E11,0))    e12
                //IF(SUM(D11:F11)<=C12,F11,IF((C12-SUM(D11:F11)+F11)>0,C12-SUM(D11:F11)+F11,0))    f12
                //(SUM(D11:F11)求和
                Double sum01 = 0d;
                for (int j = 1; j <= i; j++) {
                    String s11 = zzsxxMap.get(STR_LIST[j] + 11);
                    Double d11 = Double.valueOf(s11);
                    sum01 += d11;
                }
                String sc12 = map.get("C12");
                Double dc12 = Double.valueOf(sc12);
                if (sum01 <= dc12) {
                    map.put(STR_LIST[i] + 12, zzsxxMap.get(STR_LIST[i] + 11));
                } else {
                    //(C12-sum01+F11)
                    String s11 = zzsxxMap.get(STR_LIST[i] + 11);
                    Double d11 = Double.valueOf(s11);
                    if (dc12 - sum01 + d11 > 0) {
                        map.put(STR_LIST[i] + 12, String.valueOf((dc12 - sum01 + d11)));
                    } else {
                        map.put(STR_LIST[i] + 12, "0");
                    }
                }
            }
        }
        List<HpjParamer> list = MapToList.mapList(map, uuid);

        return list;
    }

    //  13 教育费及附加
    public List<HpjParamer> jiaoyufeijifujia(String D6) throws IllegalAccessException {
        List<HpjParamer> list10 = zengzhishui(D6);
        Map<String, String> map10 = ListToMap.getListToMap(list10);
        Map<String, String> map13 = new HashMap<>();
        for (int i = 1; i < 21; i++) {
            String s10 = map10.get(STR_LIST[i] + 10);
            s10 = strIsNUll(s10);
            Double d10 = Double.valueOf(s10);
            map13.put(STR_LIST[i] + 13, String.valueOf(MathUitl.mul(d10, 0.1)));
        }
        List<HpjParamer> list = MapToList.mapList(map13, uuid);
        return list;
    }

    // 不含税收入
    public List<HpjParamer> buhanshuishouru(String D6) throws IllegalAccessException {
        //D7+D8+D9-D11-D13
        //E7+E8+E9-E11-E13
        List<HpjParamer> list7 = ranmeidianjiashouru(D6);
        List<HpjParamer> list8 = guojiabutieshouru(D6);
        List<HpjParamer> list9 = shenjibutie(D6);
        List<HpjParamer> list11 = zengzhishuixiaoxiang(D6);
        List<HpjParamer> list13 = jiaoyufeijifujia(D6);
        Map<String, String> map7 = ListToMap.getListToMap(list7);
        Map<String, String> map8 = ListToMap.getListToMap(list8);
        Map<String, String> map9 = ListToMap.getListToMap(list9);
        Map<String, String> map11 = ListToMap.getListToMap(list11);
        Map<String, String> map13 = ListToMap.getListToMap(list13);
        Map<String, String> map = new HashMap<>();
        for (int i = 1; i < 21; i++) {
            String s7 = map7.get(STR_LIST[i] + 7);
            String s8 = map8.get(STR_LIST[i] + 8);
            String s9 = map9.get(STR_LIST[i] + 9);
            String s11 = map11.get(STR_LIST[i] + 11);
            String s13 = map13.get(STR_LIST[i] + 13);
            s7 = strIsNUll(s7);
            s8 = strIsNUll(s8);
            s9 = strIsNUll(s9);
            s11 = strIsNUll(s11);
            s13 = strIsNUll(s13);
            Double d7 = Double.valueOf(s7);
            Double d8 = Double.valueOf(s8);
            Double d9 = Double.valueOf(s9);
            Double d11 = Double.valueOf(s11);
            Double d13 = Double.valueOf(s13);
            map.put(STR_LIST[i] + 14, String.valueOf((d7 + d8 + d9 - d11 - d13)));
        }
        List<HpjParamer> list = MapToList.mapList(map, uuid);


        return list;
    }

    //  15 总成本
    public List<HpjParamer> zongchengben(String D6) throws IllegalAccessException {

        //  SUM(D16:D21)
        //SUM(E16:E21)
        //获取数据
        //d16
        List<HpjParamer> list16 = yunweifeiyong(D6);
        List<HpjParamer> list17 = tudizujing(D6);
        List<HpjParamer> list18 = tudishiyongshui(D6);
        List<HpjParamer> list19 = zhejiu(D6);
        List<HpjParamer> list20 = tanxiao(D6);
        List<HpjParamer> list21 = lixi(D6);
        Map<String, String> map16 = ListToMap.getListToMap(list16);
        Map<String, String> map17 = ListToMap.getListToMap(list17);
        Map<String, String> map18 = ListToMap.getListToMap(list18);
        Map<String, String> map19 = ListToMap.getListToMap(list19);
        Map<String, String> map20 = ListToMap.getListToMap(list20);
        Map<String, String> map21 = ListToMap.getListToMap(list21);
        Map<String, String> map15 = new HashMap();
        for (int i = 1; i < 21; i++) {
            String value16 = map16.get(STR_LIST[i] + 16);
            String value17 = map17.get(STR_LIST[i] + 17);
            String value18 = map18.get(STR_LIST[i] + 18);
            String value19 = map19.get(STR_LIST[i] + 19);
            String value20 = map20.get(STR_LIST[i] + 20);
            String value21 = map21.get(STR_LIST[i] + 21);
            value16 = strIsNUll(value16);
            value17 = strIsNUll(value17);
            value18 = strIsNUll(value18);
            value19 = strIsNUll(value19);
            value20 = strIsNUll(value20);
            value21 = strIsNUll(value21);
            Double d16 = Double.valueOf(value16);
            Double d17 = Double.valueOf(value17);
            Double d18 = Double.valueOf(value18);
            Double d19 = Double.valueOf(value19);
            Double d20 = Double.valueOf(value20);
            Double d21 = Double.valueOf(value21);
            map15.put(STR_LIST[i] + 15, String.valueOf(d16 + d17 + d18 + d19 + d20 + d21));
        }
        List<HpjParamer> list15 = MapToList.mapList(map15, uuid);
        return list15;
    }

    // 16运维费用
    public List<HpjParamer> yunweifeiyong(String D6) throws IllegalAccessException {
        Map<String, String> map = new HashMap<>();
        for (int i = 1; i < 21; i++) {
            //=后评价输入界面!D22
            map.put(STR_LIST[i] + 16, hpjsrjmmap.get(STR_LIST[i - 1] + 22));
        }
        List<HpjParamer> list = MapToList.mapList(map, uuid);
        return list;
    }

    // 17 土地租金
    public List<HpjParamer> tudizujing(String D6) throws IllegalAccessException {
        Map<String, String> map = new HashMap<>();
        for (int i = 1; i < 21; i++) {
            //=后评价输入界面!C23
            map.put(STR_LIST[i] + 17, hpjsrjmmap.get(STR_LIST[i - 1] + 23));
        }
        List<HpjParamer> list = MapToList.mapList(map, uuid);
        return list;
    }

    //18 土地使用税
    public List<HpjParamer> tudishiyongshui(String D6) throws IllegalAccessException {
        Map<String, String> map = new HashMap<>();
        for (int i = 1; i < 21; i++) {
            //=后评价输入界面!C25
            map.put(STR_LIST[i] + 18, hpjsrjmmap.get(STR_LIST[i - 1] + 25));
        }
        List<HpjParamer> list = MapToList.mapList(map, uuid);
        return list;
    }

    //  折旧
    public List<HpjParamer> zhejiu(String D6) throws IllegalAccessException {

        Map<String, String> map = new HashMap<>();
        for (int i = 1; i < 21; i++) {
            //后评价输入界面!C11*0.9/20
            String s11 = hpjsrjmmap.get("C11");
            s11 = strIsNUll(s11);
            Double d11 = Double.valueOf(s11);
            Double result0 = MathUitl.mul(d11, 0.9);
            Double result = MathUitl.div(result0, 20, 4);
            map.put(STR_LIST[i] + 19, String.valueOf(result));
        }
        List<HpjParamer> list = MapToList.mapList(map, uuid);
        return list;
    }

    //  摊销
    public List<HpjParamer> tanxiao(String D6) throws IllegalAccessException {
        //    后评价输入界面!C12/20 都相同
        Map<String, String> map = new HashMap<>();
        String s12 = hpjsrjmmap.get("C12");
        s12 = strIsNUll(s12);
        Double d12 = Double.valueOf(s12);
        Double result = MathUitl.div(d12, 20, 4);
        for (int i = 1; i < 21; i++) {
            map.put(STR_LIST[i] + 20, String.valueOf(result));
        }
        List<HpjParamer> list = MapToList.mapList(map, uuid);
        return list;
    }

    // 利息
    public List<HpjParamer> lixi(String D6) throws IllegalAccessException {

        Map<String, String> map = new HashMap<>();
        for (int i = 1; i < 21; i++) {
            //后评价输入界面!C32
            String result = "0";
            if (hpjsrjmmap.get(STR_LIST[i - 1] + 32) == null) {

            } else {
                result = hpjsrjmmap.get(STR_LIST[i - 1] + 32);
            }
            map.put(STR_LIST[i] + 21, result);
        }
        List<HpjParamer> list = MapToList.mapList(map, uuid);
        return list;
    }

    //          22利润总额
    public List<HpjParamer> lirunzong(String D6) throws IllegalAccessException {
        List<HpjParamer> list14 = buhanshuishouru(D6);
        List<HpjParamer> list15 = zongchengben(D6);
        Map<String, String> map14 = ListToMap.getListToMap(list14);
        Map<String, String> map15 = ListToMap.getListToMap(list15);
        Map<String, String> map = new HashMap<>();
        //  D14-D15
        for (int i = 1; i < 21; i++) {
            String s14 = map14.get(STR_LIST[i] + 14);
            String s15 = map15.get(STR_LIST[i] + 15);
            s14 = strIsNUll(s14);
            s15 = strIsNUll(s15);
            Double d14 = Double.valueOf(s14);
            Double d15 = Double.valueOf(s15);
            map.put(STR_LIST[i] + 22, String.valueOf(MathUitl.sub(d14, d15)));
        }
        List<HpjParamer> list = MapToList.mapList(map, uuid);
        return list;
    }

    //  23 企业所得税
    public List<HpjParamer> qiyesuodeshui(String D6) throws IllegalAccessException {
        //IF(D4<=后评价输入界面!F10,D22*0,)
        //IF(D4<=(后评价输入界面!F10+后评价输入界面!F11),D22*25%/2,)
        //IF(D4>(后评价输入界面!F10+后评价输入界面!F11),D22*25%)
        //IF(E4<=后评价输入界面!F10,E22*0,IF(E4<=(后评价输入界面!F10+后评价输入界面!F11),E22*25%/2,IF(E4>(后评价输入界面!F10+后评价输入界面!F11),E22*25%)))
        //IF(F4<=后评价输入界面!F10,F22*0,IF(F4<=(后评价输入界面!F10+后评价输入界面!F11),F22*25%/2,IF(F4>(后评价输入界面!F10+后评价输入界面!F11),F22*25%)))
        //4 22
        int[] Str_Num = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21};
        List<HpjParamer> list22 = lirunzong(D6);
        Map<String, String> map22 = ListToMap.getListToMap(list22);
        Map<String, String> map23 = new HashMap<>();
        for (int i = 1; i < 21; i++) {
            //后评价输入界面!F10
            String hstr10 = hpjsrjmmap.get("F10");
            String hstr11 = hpjsrjmmap.get("F11");
            hstr10 = strIsNUll(hstr10);
            hstr11 = strIsNUll(hstr11);
            Double dh10 = Double.parseDouble(hstr10);
            Double dh11 = Double.parseDouble(hstr11);
            if (Str_Num[i] <= dh10) {
                map23.put(STR_LIST[i] + 23, "0");
            } else {
                String st22 = map22.get(STR_LIST[i] + 22);
                st22 = strIsNUll(st22);
                Double d22 = Double.valueOf(st22);
                if (Str_Num[i] <= (dh10 + dh11)) {
                    // 求D22
                    map23.put(STR_LIST[i] + 23, String.valueOf(MathUitl.div(MathUitl.mul(d22, 0.25), 2, 4)));

                } else {
                    if (Str_Num[i] > (dh10 + dh11)) {
                        map23.put(STR_LIST[i] + 23, String.valueOf(MathUitl.mul(d22, 0.25)));
                    }
                }
            }
        }
        List<HpjParamer> list23 = MapToList.mapList(map23, uuid);
        return list23;
    }

    //24 净利润
    public List<HpjParamer> jinglirun(String D6) throws IllegalAccessException {
        //D22-D23
        //E22-E23
        List<HpjParamer> list22 = lirunzong(D6);
        List<HpjParamer> list23 = qiyesuodeshui(D6);
        Map<String, String> map22 = ListToMap.getListToMap(list22);
        Map<String, String> map23 = ListToMap.getListToMap(list23);
        Map<String, String> map24 = new LinkedHashMap<>();
        for (int i = 1; i < 21; i++) {
            String s22 = map22.get(STR_LIST[i] + 22);
            String s23 = map23.get(STR_LIST[i] + 23);
            s22 = strIsNUll(s22);
            s23 = strIsNUll(s23);
            Double d22 = Double.valueOf(s22);
            Double d23 = Double.valueOf(s23);
            map24.put(STR_LIST[i] + 24, String.valueOf(d22 - d23));
        }
        List<HpjParamer> list24 = MapToList.mapList(map24, uuid);
        return list24;
    }


    //  股权现金流量


    // TODO   现金流入30
    public List<HpjParamer> xianjingliuru30(String D6) throws Exception {
        //SUM(D31:D34)
        List<HpjParamer> list31 = ranmeidianjiashouru31(D6);
        List<HpjParamer> list32 = guojiabutieshouru32(D6);
        List<HpjParamer> list33 = shengjibutieshouru33(D6);
        List<HpjParamer> list34 = huishougudingzichanyuzhi34(D6);
        Map<String, String> map31 = ListToMap.getListToMap(list31);
        Map<String, String> map32 = ListToMap.getListToMap(list32);
        Map<String, String> map33 = ListToMap.getListToMap(list33);
        Map<String, String> map34 = ListToMap.getListToMap(list34);
        Map<String, String> map30 = new HashMap<>();
        for (int i = 1; i < 21; i++) {
            String str31 = map31.get(STR_LIST[i] + 31);
            String str32 = map32.get(STR_LIST[i] + 32);
            String str33 = map33.get(STR_LIST[i] + 33);
            String str34 = map34.get(STR_LIST[i] + 34);
            str31 = strIsNUll(str31);
            str32 = strIsNUll(str32);
            str33 = strIsNUll(str33);
            str34 = strIsNUll(str34);
            Double d31 = Double.valueOf(str31);
            Double d32 = Double.valueOf(str32);
            Double d33 = Double.valueOf(str33);
            Double d34 = Double.valueOf(str34);
            Double value = d31 + d32 + d33 + d34;
            map30.put(STR_LIST[i] + 30, String.valueOf(value));
        }
        List<HpjParamer> list30 = MapToList.mapList(map30, uuid);
        return list30;
    }

    //            燃煤电价收入31
    public List<HpjParamer> ranmeidianjiashouru31(String D6) throws Exception {
        //D7
        List<HpjParamer> list7 = ranmeidianjiashouru(D6);
        List<HpjParamer> list30 = new ArrayList<>();
        for (HpjParamer h7 : list7) {
            HpjParamer h30 = new HpjParamer();
            h30.setPosition(h7.getPosition().substring(0, 1) + 31);
            h30.setComputer(h7.getComputer());
            h30.setUuid(h7.getUuid());
            list30.add(h30);
        }
        return list30;

    }

    //    国家补贴收入32
    public List<HpjParamer> guojiabutieshouru32(String D6) throws Exception {
        // D32 0
        //H32  G8/12*3+H8/12*9
        //i32  H8/12*3+I8/12*9
        //j32  I8/12*3+J8/12*9
        //V8/12*3+W8
        List<HpjParamer> list8 = guojiabutieshouru(D6);
        Map<String, String> map8 = ListToMap.getListToMap(list8);
        Map<String, String> map32 = new HashMap<>();
        for (int i = 1; i < 21; i++) {
            if (i == 1) {
                map32.put("D32", "0");
            } else if (i == 2) {
                //   IF(后评价输入界面!F12=24,D8+E8*9/12,0)
                //IF(后评价输入界面!F12=24,
                // D8+E8*9/12,0) E32
                String hs12 = hpjsrjmmap.get("F12");
                hs12 = strIsNUll(hs12);
                Double d12 = Double.valueOf(hs12);
                if (d12 == 24) {
                    String strd8 = map8.get(STR_LIST[i - 1] + 8);
                    String stre8 = map8.get(STR_LIST[i] + 8);
                    //D8+E8*9/12
                    strd8 = strIsNUll(strd8);
                    stre8 = strIsNUll(stre8);
                    Double dd8 = Double.valueOf(strd8);
                    Double de8 = Double.valueOf(stre8);
                    String value = String.valueOf(dd8 + MathUitl.div(MathUitl.mul(de8, 9), 12, 4));
                    map32.put(STR_LIST[i] + 32, value);
                } else {
                    map32.put(STR_LIST[i] + 32, "0");
                }
            } else if (i == 3) {
                //   IF(后评价输入界面!F12=24,E8*3/12+F8*9/12,
                // IF(后评价输入界面!F12=36,D8+E8+F8*9/12
                // ,0))
                String hs12 = hpjsrjmmap.get("F12");
                hs12 = strIsNUll(hs12);
                Double d12 = Double.valueOf(hs12);
                String sdd8 = map8.get(STR_LIST[i - 2] + 8);
                String strd8 = map8.get(STR_LIST[i - 1] + 8);
                String stre8 = map8.get(STR_LIST[i] + 8);
                //E8*3/12+F8*9/12,
                sdd8 = strIsNUll(sdd8);
                strd8 = strIsNUll(strd8);
                stre8 = strIsNUll(stre8);
                Double ddd8 = Double.valueOf(sdd8);//d8
                Double dd8 = Double.valueOf(strd8);//e8
                Double de8 = Double.valueOf(stre8);//f8
                if (d12 == 24) {

                    //E8*3/12
                    Double fist = MathUitl.div(MathUitl.mul(dd8, 3), 12, 4);
                    //F8*9/12,
                    Double second = MathUitl.div(MathUitl.mul(de8, 9), 12, 4);
                    String value = String.valueOf(fist + second);
                    map32.put(STR_LIST[i] + 32, value);
                } else {
                    if (d12 == 36) {
                        //IF(后评价输入界面!F12=36,
                        // D8+E8+F8*9/12,
                        Double thrid = MathUitl.div(MathUitl.mul(de8, 9), 12, 4);
                        String total = String.valueOf(ddd8 + dd8 + thrid);
                        map32.put(STR_LIST[i] + 32, total);
                    } else {
                        map32.put(STR_LIST[i] + 32, "0");
                    }
                }
            } else if (i == 4) {
                //G32  IF(后评价输入界面!F12=24,F8*3/12+G8*9/12,
                // IF(后评价输入界面!F12=36,F8*3/12+G8*9/12,
                // IF(后评价输入界面!F12=48,
                // D8+E8+F8+G8*9/12,
                // 0)))
                String hs12 = hpjsrjmmap.get("F12");
                hs12 = strIsNUll(hs12);
                Double d12 = Double.valueOf(hs12);//后评价输入界面!F12=24
                String sd8 = map8.get(STR_LIST[i - 3] + 8);//d8
                String se8 = map8.get(STR_LIST[i - 2] + 8);//e8
                sd8 = strIsNUll(sd8);
                se8 = strIsNUll(se8);
                Double dd8 = Double.valueOf(sd8);//d8
                Double de8 = Double.valueOf(se8);//e8

                String sf8 = map8.get(STR_LIST[i - 1] + 8);//f8
                String sg8 = map8.get(STR_LIST[i] + 8);//g8
                sf8 = strIsNUll(sf8);
                sg8 = strIsNUll(sg8);
                Double df8 = Double.valueOf(sf8);//f8
                Double dg8 = Double.valueOf(sg8);//g8
                if (d12 == 24) {//后评价输入界面!F12=24
                    //F8*3/12+G8*9/12
                    Double value = MathUitl.div(MathUitl.mul(df8, 3), 12, 4) + MathUitl.div(MathUitl.mul(dg8, 9), 12, 4);
                    map32.put(STR_LIST[i] + 32, String.valueOf(value));
                } else {
                    if (d12 == 36) {// IF(后评价输入界面!F12=36,F8*3/12+G8*9/12,
                        //F8*3/12+G8*9/12,
                        Double value = MathUitl.div(MathUitl.mul(df8, 3), 12, 4) + MathUitl.div(MathUitl.mul(dg8, 9), 12, 4);
                        map32.put(STR_LIST[i] + 32, String.valueOf(value));
                    } else {
                        // IF(后评价输入界面!F12=48,
                        // D8+E8+F8+G8*9/12,
                        // 0)))
                        if (d12 == 48) {
                            Double valuefirst = MathUitl.div(MathUitl.mul(dg8, 9), 12, 4);
                            Double value = dd8 + de8 + df8 + valuefirst;
                            map32.put(STR_LIST[i] + 32, String.valueOf(value));
                        } else {
                            map32.put(STR_LIST[i] + 32, "0");
                        }
                    }
                }

            } else if (i == 20) {
                //  V8/12*3+W8
                String sv8 = map8.get(STR_LIST[i - 1] + 8);//v8
                String sw8 = map8.get(STR_LIST[i] + 8);//w8
                sv8 = strIsNUll(sv8);
                sw8 = strIsNUll(sw8);
                Double dv8 = Double.valueOf(sv8);//d8
                Double dw8 = Double.valueOf(sw8);//e8
                Double firstvalue = MathUitl.div(dv8, 12, 4);
                Double value = MathUitl.mul(firstvalue, 3) + dw8;
                map32.put(STR_LIST[i] + 32, String.valueOf(value));
            } else {
//H32  G8/12*3+H8/12*9
                String sg8 = map8.get(STR_LIST[i - 1] + 8);//g8
                String sh8 = map8.get(STR_LIST[i] + 8);//h8
                sg8 = strIsNUll(sg8);
                sh8 = strIsNUll(sh8);
                Double dg8 = Double.valueOf(sg8);//g8
                Double dh8 = Double.valueOf(sh8);//h8
                Double value = MathUitl.mul(MathUitl.div(dg8, 12, 4), 3) + MathUitl.mul(MathUitl.div(dh8, 12, 4), 9);
                map32.put(STR_LIST[i] + 32, String.valueOf(value));
            }
        }
        //V32
        // SUM(D32:W32);
        Double tatle = 0d;
        for (int i = 1; i < 21; i++) {


            String sone = map32.get(STR_LIST[i] + 32);
            sone = strIsNUll(sone);
            Double done = Double.valueOf(sone);
            tatle += done;
        }
        map32.put(STR_LIST[21] + 32, String.valueOf(tatle));
        List<HpjParamer> list32 = MapToList.mapList(map32, uuid);

        return list32;
    }

    //            省级补贴33
    public List<HpjParamer> shengjibutieshouru33(String D6) throws Exception {
        //D33 (12-后评价输入界面!F13)/12*计算过程!D9
        //E33  后评价输入界面!F13/12*计算过程!D9+(12-后评价输入界面!F13)/12*E9
        //F33  后评价输入界面!F13/12*计算过程!E9+(12-后评价输入界面!F13)/12*F9
        //G33  后评价输入界面!F13/12*计算过程!F9+(12-后评价输入界面!F13)/12*G9
        // 后评价输入界面!F13
        String hf13 = hpjsrjmmap.get("F13");
        List<HpjParamer> list9 = shenjibutie(D6);
        Map<String, String> map9 = ListToMap.getListToMap(list9);
        hf13 = strIsNUll(hf13);
        Double dhf13 = Double.valueOf(hf13);
        Map<String, String> map33 = new HashMap<>();
        for (int i = 1; i < 21; i++) {
            if (i == 1) {
                //(12-后评价输入界面!F13)/12*计算过程!D9
                String str9 = map9.get(STR_LIST[i] + 9);
                str9 = strIsNUll(str9);
                Double d9 = Double.valueOf(str9);
                Double first = MathUitl.div((12 - dhf13), 12, 4);
                Double value = MathUitl.mul(first, d9);
                map33.put(STR_LIST[i] + 33, String.valueOf(value));
            } else {
                //E33  后评价输入界面!F13/12*计算过程!D9+(12-后评价输入界面!F13)/12*E9
                //计算过程!D9
                String sd9 = map9.get(STR_LIST[i - 1] + 9);
                String se9 = map9.get(STR_LIST[i] + 9);
                sd9 = strIsNUll(sd9);
                se9 = strIsNUll(se9);
                Double dd9 = Double.valueOf(sd9);
                Double de9 = Double.valueOf(se9);
                Double first = MathUitl.div(dhf13, 12, 4);
                Double second = MathUitl.div((12 - dhf13), 12, 4);
                Double value = MathUitl.mul(first, dd9) + MathUitl.mul(second, de9);
                map33.put(STR_LIST[i] + 33, String.valueOf(value));
            }
        }
        List<HpjParamer> list33 = MapToList.mapList(map33, uuid);
        return list33;
    }

    //    回收固定资产余值34
    public List<HpjParamer> huishougudingzichanyuzhi34(String D6) throws Exception {
        List<HpjParamer> list34 = new ArrayList<>();
        for (int i = 0; i < 21; i++) {
            HpjParamer hpjParamer = new HpjParamer();

            if (i == 20) {
                //  后评价输入界面!C11*0.1 W34
                String hc11 = hpjsrjmmap.get("C11");
                hc11 = strIsNUll(hc11);
                Double dc11 = Double.valueOf(hc11);
                Double dvalue = MathUitl.mul(dc11, 0.1);
                hpjParamer.setUuid(uuid);
                hpjParamer.setComputer(String.valueOf(dvalue));
                hpjParamer.setPosition(STR_LIST[i] + 34);
            } else {
                hpjParamer.setUuid(uuid);
                hpjParamer.setComputer("0");
                hpjParamer.setPosition(STR_LIST[i] + 34);
            }
            list34.add(hpjParamer);
        }
        return list34;
    }

    // TODO           现金流出35
    public List<HpjParamer> xianjingliuchu35(String D6) throws Exception {
        // SUM(C36:C43)

        List<HpjParamer> list36 = huanben36(D6);
        List<HpjParamer> list37 = fuxi37(D6);
        List<HpjParamer> list38 = znegzhishui38(D6);
        List<HpjParamer> list39 = jiaoyufeifujia39(D6);
        List<HpjParamer> list40 = yunweifeiyong40(D6);
        List<HpjParamer> list41 = tudizujing41(D6);
        List<HpjParamer> list42 = tudishiyongshui42(D6);
        List<HpjParamer> list43 = suodeshui43(D6);
        Map<String, String> map36 = ListToMap.getListToMap(list36);
        Map<String, String> map37 = ListToMap.getListToMap(list37);
        Map<String, String> map38 = ListToMap.getListToMap(list38);
        Map<String, String> map39 = ListToMap.getListToMap(list39);
        Map<String, String> map40 = ListToMap.getListToMap(list40);
        Map<String, String> map41 = ListToMap.getListToMap(list41);
        Map<String, String> map42 = ListToMap.getListToMap(list42);
        Map<String, String> map43 = ListToMap.getListToMap(list43);
        Map<String, String> map35 = new HashMap<>();
        for (int i = 0; i < 21; i++) {
            String str36 = map36.get(STR_LIST[i] + 36);
            String str37 = map37.get(STR_LIST[i] + 37);
            String str38 = map38.get(STR_LIST[i] + 38);
            String str39 = map39.get(STR_LIST[i] + 39);
            String str40 = map40.get(STR_LIST[i] + 40);
            String str41 = map41.get(STR_LIST[i] + 41);
            String str42 = map42.get(STR_LIST[i] + 42);
            String str43 = map43.get(STR_LIST[i] + 43);
            str36 = strIsNUll(str36);
            str37 = strIsNUll(str37);
            str38 = strIsNUll(str38);
            str39 = strIsNUll(str39);
            str40 = strIsNUll(str40);
            str41 = strIsNUll(str41);
            str42 = strIsNUll(str42);
            str43 = strIsNUll(str43);
            Double d36 = Double.valueOf(str36);
            Double d37 = Double.valueOf(str37);
            Double d38 = Double.valueOf(str38);
            Double d39 = Double.valueOf(str39);
            Double d40 = Double.valueOf(str40);
            Double d41 = Double.valueOf(str41);
            Double d42 = Double.valueOf(str42);
            Double d43 = Double.valueOf(str43);
            Double value = d36 + d37 + d38 + d39 + d40 + d41 + d42 + d43;
            map35.put(STR_LIST[i] + 35, String.valueOf(value));
        }
        List<HpjParamer> list35 = MapToList.mapList(map35, uuid);
        return list35;
    }

    //    还本36
    public List<HpjParamer> huanben36(String D6) throws Exception {
        //后评价输入界面!C13 C36
        //后评价输入界面!C31 D36
        //后评价输入界面!D31  E36
        Map<String, String> map36 = new HashMap<>();
        for (int i = 0; i < 21; i++) {
            if (i == 0) {
                String hs13 = hpjsrjmmap.get(STR_LIST[i] + 13);
                map36.put(STR_LIST[i] + 36, hs13);
            } else {
                String hc = hpjsrjmmap.get(STR_LIST[i - 1] + 31);
                hc = strIsNUll(hc);
                map36.put(STR_LIST[i] + 36, hc);
            }
        }
        List<HpjParamer> list36 = MapToList.mapList(map36, uuid);
        return list36;
    }

    //            付息37
    public List<HpjParamer> fuxi37(String D6) throws Exception {
        Map<String, String> map37 = new HashMap<>();
        for (int i = 1; i < 21; i++) {
            //后评价输入界面!C32 D37
//=后评价输入界面!E32  F37
            String one = hpjsrjmmap.get(STR_LIST[i - 1] + 32);
            one = strIsNUll(one);
            map37.put(STR_LIST[i] + 37, one);
        }
        List<HpjParamer> list37 = MapToList.mapList(map37, uuid);
        return list37;
    }

    //    增值税38
    public List<HpjParamer> znegzhishui38(String D6) throws Exception {
        List<HpjParamer> list10 = zengzhishui(D6);
        List<HpjParamer> list38 = new ArrayList<>();
        for (HpjParamer hpj : list10) {
            HpjParamer hpjParamer = new HpjParamer();
            hpjParamer.setUuid(hpj.getUuid());
            hpjParamer.setComputer(hpj.getComputer());
            hpjParamer.setPosition(hpj.getPosition().substring(0, 1) + 38);
            list38.add(hpjParamer);
        }

        return list38;
    }

    //            教育费及附加39
    public List<HpjParamer> jiaoyufeifujia39(String D6) throws Exception {
        //D13 D39
        List<HpjParamer> list13 = jiaoyufeijifujia(D6);
        List<HpjParamer> list39 = new ArrayList<>();
        for (HpjParamer hpj : list13) {
            HpjParamer hpjParamer = new HpjParamer();
            hpjParamer.setUuid(hpj.getUuid());
            hpjParamer.setComputer(hpj.getComputer());
            hpjParamer.setPosition(hpj.getPosition().substring(0, 1) + 39);
            list39.add(hpjParamer);
        }

        return list39;
    }

    //    运维费用40
    public List<HpjParamer> yunweifeiyong40(String D6) throws Exception {
        //16
        List<HpjParamer> list16 = yunweifeiyong(D6);
        List<HpjParamer> list40 = new ArrayList<>();
        for (HpjParamer hpj : list16) {
            HpjParamer hpjParamer = new HpjParamer();
            hpjParamer.setUuid(hpj.getUuid());
            hpjParamer.setComputer(hpj.getComputer());
            hpjParamer.setPosition(hpj.getPosition().substring(0, 1) + 40);
            list40.add(hpjParamer);
        }

        return list40;
    }

    //            土地租金41
    public List<HpjParamer> tudizujing41(String D6) throws Exception {
        //  后评价输入界面!C24 D41
        List<HpjParamer> list41 = new ArrayList<>();
        for (int i = 1; i < 21; i++) {
            HpjParamer hpjParamer = new HpjParamer();
            String hs24 = hpjsrjmmap.get(STR_LIST[i - 1] + 24);
            hs24 = strIsNUll(hs24);
            hpjParamer.setPosition(STR_LIST[i] + 41);
            hpjParamer.setComputer(hs24);
            hpjParamer.setUuid(uuid);
            list41.add(hpjParamer);
        }
        return list41;
    }

    //    土地使用税42
    public List<HpjParamer> tudishiyongshui42(String D6) throws Exception {
        //16
        List<HpjParamer> list18 = tudishiyongshui(D6);
        List<HpjParamer> list42 = new ArrayList<>();
        for (HpjParamer hpj : list18) {
            HpjParamer hpjParamer = new HpjParamer();
            hpjParamer.setUuid(hpj.getUuid());
            hpjParamer.setComputer(hpj.getComputer());
            hpjParamer.setPosition(hpj.getPosition().substring(0, 1) + 42);
            list42.add(hpjParamer);
        }

        return list42;
    }

    //            所得税43
    public List<HpjParamer> suodeshui43(String D6) throws Exception {
        //23
        List<HpjParamer> list23 = qiyesuodeshui(D6);
        List<HpjParamer> list43 = new ArrayList<>();
        for (HpjParamer hpj : list23) {
            HpjParamer hpjParamer = new HpjParamer();
            hpjParamer.setUuid(hpj.getUuid());
            hpjParamer.setComputer(hpj.getComputer());
            hpjParamer.setPosition(hpj.getPosition().substring(0, 1) + 43);
            list43.add(hpjParamer);
        }

        return list43;
    }

    //    净现金流量44
    public List<HpjParamer> jingxianjingliuliang44(String D6) throws Exception {
        //30-35
        List<HpjParamer> list30 = xianjingliuru30(D6);
        List<HpjParamer> list35 = xianjingliuchu35(D6);
        Map<String, String> map30 = ListToMap.getListToMap(list30);
        Map<String, String> map35 = ListToMap.getListToMap(list35);
        Map<String, String> map44 = new HashMap<>();
        for (int i = 0; i < 21; i++) {
            String one30 = map30.get(STR_LIST[i] + 30);
            String one35 = map35.get(STR_LIST[i] + 35);
            one30 = strIsNUll(one30);
            one35 = strIsNUll(one35);
            Double d30 = Double.valueOf(one30);
            Double d35 = Double.valueOf(one35);
            Double value = MathUitl.sub(d30, d35);
            map44.put(STR_LIST[i] + 44, String.valueOf(value));
        }
        List<HpjParamer> list44 = MapToList.mapList(map44, uuid);
        return list44;
    }


    //   50 TODO 现金流入
    public List<HpjParamer> xianjingliuru(String D6) throws Exception {
        //SUM(C51:C54)
        //SUM(D31:D34)
        List<HpjParamer> list51 = ranmeidianjiashouru51(D6);
        List<HpjParamer> list52 = guojiabutie52(D6);
        List<HpjParamer> list53 = shengshibutie53(D6);
        List<HpjParamer> list54 = huishougudingzichanyuzhi54(D6);
        Map<String, String> map51 = ListToMap.getListToMap(list51);
        Map<String, String> map52 = ListToMap.getListToMap(list52);
        Map<String, String> map53 = ListToMap.getListToMap(list53);
        Map<String, String> map54 = ListToMap.getListToMap(list54);
        Map<String, String> map50 = new HashMap<>();
        for (int i = 1; i < 21; i++) {
            String str51 = map51.get(STR_LIST[i] + 51);
            String str52 = map52.get(STR_LIST[i] + 52);
            String str53 = map53.get(STR_LIST[i] + 53);
            String str54 = map54.get(STR_LIST[i] + 54);
            str51 = strIsNUll(str51);
            str52 = strIsNUll(str52);
            str53 = strIsNUll(str53);
            str54 = strIsNUll(str54);
            Double d51 = Double.valueOf(str51);
            Double d52 = Double.valueOf(str52);
            Double d53 = Double.valueOf(str53);
            Double d54 = Double.valueOf(str54);
            Double value = d51 + d52 + d53 + d54;
            map50.put(STR_LIST[i] + 50, String.valueOf(value));
        }
        List<HpjParamer> list50 = MapToList.mapList(map50, uuid);
        return list50;
    }

    //    51        燃煤电价收入
    public List<HpjParamer> ranmeidianjiashouru51(String D6) throws Exception {
        List<HpjParamer> list7 = ranmeidianjiashouru(D6);
        List<HpjParamer> list51 = new ArrayList<>();
        for (HpjParamer h7 : list7) {
            HpjParamer h51 = new HpjParamer();
            h51.setPosition(h7.getPosition().substring(0, 1) + 51);
            h51.setComputer(h7.getComputer());
            h51.setUuid(h7.getUuid());
            list51.add(h51);
        }
        return list51;
    }

    //   52 国家补贴
    public List<HpjParamer> guojiabutie52(String D6) throws Exception {
        List<HpjParamer> list32 = guojiabutieshouru32(D6);
        List<HpjParamer> list52 = new ArrayList<>();
        for (HpjParamer h32 : list32) {
            HpjParamer h52 = new HpjParamer();
            h52.setPosition(h32.getPosition().substring(0, 1) + 52);
            h52.setComputer(h32.getComputer());
            h52.setUuid(h32.getUuid());
            list52.add(h52);
        }
        return list52;
    }

    //     53       省市补贴
    public List<HpjParamer> shengshibutie53(String D6) throws Exception {
        List<HpjParamer> list33 = shengjibutieshouru33(D6);
        List<HpjParamer> list53 = new ArrayList<>();
        for (HpjParamer h33 : list33) {
            HpjParamer h53 = new HpjParamer();
            h53.setPosition(h33.getPosition().substring(0, 1) + 53);
            h53.setComputer(h33.getComputer());
            h53.setUuid(h33.getUuid());
            list53.add(h53);
        }
        return list53;
    }

    //   54 回收固定资产余值
    public List<HpjParamer> huishougudingzichanyuzhi54(String D6) throws Exception {
        List<HpjParamer> list34 = huishougudingzichanyuzhi34(D6);
        List<HpjParamer> list54 = new ArrayList<>();
        for (HpjParamer h34 : list34) {
            HpjParamer h54 = new HpjParamer();
            h54.setPosition(h34.getPosition().substring(0, 1) + 54);
            h54.setComputer(h34.getComputer());
            h54.setUuid(h34.getUuid());
            list54.add(h54);
        }
        return list54;
    }

    //     55  TODO     现金流出
    public List<HpjParamer> xianjingliuchu55(String D6) throws Exception {
        //  SUM(D56:D62)
        List<HpjParamer> list56 = jianshetouzi56(D6);
        List<HpjParamer> list57 = yunweifeiyong57(D6);
        List<HpjParamer> list58 = tudizujin58(D6);
        List<HpjParamer> list59 = tudishiyongshui59(D6);
        List<HpjParamer> list60 = zengzhishui60(D6);
        List<HpjParamer> list61 = jiangyufeifujia61(D6);
        List<HpjParamer> list62 = tiaozengsuodeshui62(D6);

        Map<String, String> map56 = ListToMap.getListToMap(list56);
        Map<String, String> map57 = ListToMap.getListToMap(list57);
        Map<String, String> map58 = ListToMap.getListToMap(list58);
        Map<String, String> map59 = ListToMap.getListToMap(list59);
        Map<String, String> map60 = ListToMap.getListToMap(list60);
        Map<String, String> map61 = ListToMap.getListToMap(list61);
        Map<String, String> map62 = ListToMap.getListToMap(list62);

        Map<String, String> map55 = new HashMap<>();
        for (int i = 0; i < 21; i++) {
            String str56 = map56.get(STR_LIST[i] + 56);
            String str57 = map57.get(STR_LIST[i] + 57);
            String str58 = map58.get(STR_LIST[i] + 58);
            String str59 = map59.get(STR_LIST[i] + 59);
            String str60 = map60.get(STR_LIST[i] + 60);
            String str61 = map61.get(STR_LIST[i] + 61);
            String str62 = map62.get(STR_LIST[i] + 62);

            str56 = strIsNUll(str56);
            str57 = strIsNUll(str57);
            str58 = strIsNUll(str58);
            str59 = strIsNUll(str59);
            str60 = strIsNUll(str60);
            str61 = strIsNUll(str61);
            str62 = strIsNUll(str62);

            Double d56 = Double.valueOf(str56);
            Double d57 = Double.valueOf(str57);
            Double d58 = Double.valueOf(str58);
            Double d59 = Double.valueOf(str59);
            Double d60 = Double.valueOf(str60);
            Double d61 = Double.valueOf(str61);
            Double d62 = Double.valueOf(str62);

            Double value = d56 + d57 + d58 + d59 + d60 + d61 + d62 ;
            map55.put(STR_LIST[i] + 55, String.valueOf(value));
        }
        List<HpjParamer> list55 = MapToList.mapList(map55, uuid);
        return list55;
    }

    //    56建设投资
    public List<HpjParamer> jianshetouzi56(String D6) throws Exception {
        //=后评价输入界面!C10+后评价输入界面!C11+后评价输入界面!C12
        List<HpjParamer> list56=new ArrayList<>();
        for (int i = 0; i < 21; i++) {
            if (i == 0) {
                String hs10 = hpjsrjmmap.get("C10");
                String hs11 = hpjsrjmmap.get("C11");
                String hs12 = hpjsrjmmap.get("C12");
                hs10 = strIsNUll(hs10);
                hs11 = strIsNUll(hs11);
                hs12 = strIsNUll(hs12);
                Double d10 = Double.valueOf(hs10);
                Double d11 = Double.valueOf(hs11);
                Double d12 = Double.valueOf(hs12);
                HpjParamer hpjParamer = new HpjParamer();
                hpjParamer.setUuid(uuid);
                hpjParamer.setPosition(STR_LIST[i] + 56);
                hpjParamer.setComputer(String.valueOf(MathUitl.add(MathUitl.add(d10,d11),d12)));
                list56.add(hpjParamer);
            }else {
                HpjParamer hpjParamer = new HpjParamer();
                hpjParamer.setUuid(uuid);
                hpjParamer.setPosition(STR_LIST[i] + 56);
                hpjParamer.setComputer("0");
                list56.add(hpjParamer);
            }
        }
        return list56;
    }

    //      57      运维费用
    public List<HpjParamer> yunweifeiyong57(String D6) throws Exception {
        List<HpjParamer> list40 = yunweifeiyong40(D6);
        List<HpjParamer> list57 = new ArrayList<>();
        for (HpjParamer h40 : list40) {
            HpjParamer h57 = new HpjParamer();
            h57.setPosition(h40.getPosition().substring(0, 1) + 57);
            h57.setComputer(h40.getComputer());
            h57.setUuid(h40.getUuid());
            list57.add(h57);
        }
        return list57;
    }

    //    58土地租金
    public List<HpjParamer> tudizujin58(String D6) throws Exception {
        List<HpjParamer> list41 = tudizujing41(D6);
        List<HpjParamer> list58 = new ArrayList<>();
        for (HpjParamer h41 : list41) {
            HpjParamer h58 = new HpjParamer();
            h58.setPosition(h41.getPosition().substring(0, 1) + 58);
            h58.setComputer(h41.getComputer());
            h58.setUuid(h41.getUuid());
            list58.add(h58);
        }
        return list58;
    }

    //      59      土地使用税
    public List<HpjParamer> tudishiyongshui59(String D6) throws Exception {
        List<HpjParamer> list42 = tudishiyongshui42(D6);
        List<HpjParamer> list59 = new ArrayList<>();
        for (HpjParamer h42 : list42) {
            HpjParamer h59 = new HpjParamer();
            h59.setPosition(h42.getPosition().substring(0, 1) + 59);
            h59.setComputer(h42.getComputer());
            h59.setUuid(h42.getUuid());
            list59.add(h59);
        }
        return list59;
    }

    //    60增值税
    public List<HpjParamer> zengzhishui60(String D6) throws Exception {
        List<HpjParamer> list38 = znegzhishui38(D6);
        List<HpjParamer> list60 = new ArrayList<>();
        for (HpjParamer h38 : list38) {
            HpjParamer h60 = new HpjParamer();
            h60.setPosition(h38.getPosition().substring(0, 1) + 60);
            h60.setComputer(h38.getComputer());
            h60.setUuid(h38.getUuid());
            list60.add(h60);
        }
        return list60;
    }

    //      61      教育费及附加
    public List<HpjParamer> jiangyufeifujia61(String D6) throws Exception {
        List<HpjParamer> list39 = jiaoyufeifujia39(D6);
        List<HpjParamer> list61 = new ArrayList<>();
        for (HpjParamer h39 : list39) {
            HpjParamer h61 = new HpjParamer();
            h61.setPosition(h39.getPosition().substring(0, 1) + 61);
            h61.setComputer(h39.getComputer());
            h61.setUuid(h39.getUuid());
            list61.add(h61);
        }
        return list61;
    }

    //   62 调整所得税
    public List<HpjParamer> tiaozengsuodeshui62(String D6) throws Exception {
      //  =IF(E4<=后评价输入界面!F10,0,
        // IF(E4<=(后评价输入界面!F10+后评价输入界面!F11),E43+E21*12.5%,
        // IF(E4>(后评价输入界面!F10+后评价输入界面!F11),E23+E21*25%))) e62
      //  =IF(D4<=后评价输入界面!F10,0,IF(D4<=(后评价输入界面!F10+后评价输入界面!F11),D43+D21*12.5%,IF(D4>(后评价输入界面!F10+后评价输入界面!F11),D23+D21*25%))) d62
        //4 后f10 后f11 e43 23 21
        int[] Str_Num = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21};
        List<HpjParamer> list21 = lixi(D6);
        List<HpjParamer> list23 = qiyesuodeshui(D6);
        List<HpjParamer> list43 = suodeshui43(D6);
        Map<String, String> map21 = ListToMap.getListToMap(list21);
        Map<String, String> map23 = ListToMap.getListToMap(list23);
        Map<String, String> map43 = ListToMap.getListToMap(list43);
        Map<String, String> map62 = new HashMap<>();
        for (int i = 1; i < 21; i++) {
            //后评价输入界面!F10
            String hstr10 = hpjsrjmmap.get("F10");
            String hstr11 = hpjsrjmmap.get("F11");
            hstr10 = strIsNUll(hstr10);
            hstr11 = strIsNUll(hstr11);
            Double dh10 = Double.parseDouble(hstr10);
            Double dh11 = Double.parseDouble(hstr11);

            if (Str_Num[i] <= dh10) {
               // IF(E4<=后评价输入界面!F10,0,
                map62.put(STR_LIST[i] + 62, "0");
            } else {
                //IF(E4<=(后评价输入界面!F10+后评价输入界面!F11),E43+E21*12.5%,
                String st21 = map21.get(STR_LIST[i] + 21);
                st21 = strIsNUll(st21);
                Double d21 = Double.valueOf(st21);
                String st23 = map23.get(STR_LIST[i] + 23);
                st23 = strIsNUll(st23);
                Double d23 = Double.valueOf(st23);
                String st43 = map43.get(STR_LIST[i] + 43);
                st43 = strIsNUll(st43);
                Double d43 = Double.valueOf(st43);
                if (Str_Num[i] <= (dh10 + dh11)) {
                    // E43+E21*12.5%,
                    map62.put(STR_LIST[i] + 62, String.valueOf(MathUitl.add(d43,MathUitl.mul(d21, 0.125))));

                } else {
                    // IF(E4>(后评价输入界面!F10+后评价输入界面!F11),E23+E21*25%))) e62
                    if (Str_Num[i] > (dh10 + dh11)) {
                        map62.put(STR_LIST[i] + 62, String.valueOf(MathUitl.mul(d21, 0.25)+d23));
                    }
                }
            }
        }
        List<HpjParamer> list62 = MapToList.mapList(map62, uuid);
        return list62;

    }

    //     63       净现金流量
    public List<HpjParamer> jingxianjingliuliang63(String D6) throws Exception {
        List<HpjParamer> list50 = xianjingliuru(D6);
        List<HpjParamer> list55 = xianjingliuchu55(D6);
        Map<String, String> map50 = ListToMap.getListToMap(list50);
        Map<String, String> map55 = ListToMap.getListToMap(list55);
        Map<String, String> map63 = new HashMap<>();
        for (int i = 0; i < 21; i++) {
            String one50 = map50.get(STR_LIST[i] + 50);
            String one55 = map55.get(STR_LIST[i] + 55);
            one50 = strIsNUll(one50);
            one55 = strIsNUll(one55);
            Double d50 = Double.valueOf(one50);
            Double d55 = Double.valueOf(one55);
            Double value = MathUitl.sub(d50, d55);
            map63.put(STR_LIST[i] + 63, String.valueOf(value));
        }
        List<HpjParamer> list63 = MapToList.mapList(map63, uuid);
        return list63;
    }

    public String strIsNUll(String s) {
        if (StringUtils.isEmpty(s)) {
            s = "0";
        }
        return s;
    }
}
